﻿/**********************************天使物流*******************************************
* 功能描述:结算管理-进项发票管理
* 作者:石锦涛
* 时间:2022-01-11
* 
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.SettleAccounts.NewInputInvoices;
using Volo.Abp.Application.Services;

namespace TianShiProject.SettleAccounts.NewInputInvoices
{
    public class NewInputApp:ApplicationService
    {
        private readonly INewInputAppRepository _newInputAppRepository;
        public NewInputApp(INewInputAppRepository newInputAppRepository)
        {
            _newInputAppRepository = newInputAppRepository;
        }

        /// <summary>
        /// 分页显示
        /// </summary>
        /// <returns></returns>
        public async Task<PageResponse<NewInputInvoiceDto>> GetNewInput(string name, int? clas, string times, int pageindex = 1, int pagesize = 5)
        {
            try
            {
                return await _newInputAppRepository.GetNewInput(name, clas, times, pageindex, pagesize);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        ///  进项发票逻辑删除
        /// </summary>
        /// <returns></returns>
        public async Task<PageResponse<NewInputInvoiceDto>> DeleteNewInput(int Id)
        {
            try
            {
                return await _newInputAppRepository.DeleteNewInput(Id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 修改进项发票
        /// </summary>
        /// <param name="newInput"></param>
        /// <returns></returns>
        public async Task<PageResponse<int>> UpdateNewInput(NewInputInvoiceDto newInput)
        {
            try
            {
                return await _newInputAppRepository.UpdateNewInput(newInput);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 新增进项发票
        /// </summary>
        /// <param name="newInput"></param>
        /// <returns></returns>
        public async Task<PageResponse<int>> PostNewInput(NewInputInvoiceDto newInput)
        {
            try
            {
                return await _newInputAppRepository.PostNewInput(newInput);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量逻辑删除进项发票
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task<PageResponse<NewInputInvoiceDto>> DeleteNewInputMent(string Id)
        {
            try
            {
                return await _newInputAppRepository.DeleteNewInputMent(Id);
            }
            catch (Exception)
            {

                throw;
            }
        }


    }
}
